package IO;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Test2 {
    public static void main(String[] args)  {

        try( FileInputStream fi = new FileInputStream("D:/img1/6ca2258c82b5b3a9c6c003904f253531.jpg");
            FileOutputStream fo = new FileOutputStream("D:/img2/6ca2258c82b5b3a9c6c003904f253531.jpg");) {

            byte[] bytes = new byte[1024];
            int t;
            while ((t=fi.read(bytes))!=-1){
                fo.write(bytes,0,t);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
